package com.kkb.kkbauth.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author yuyuhzy
 * @title: User
 * @projectName kkb-parent-v2
 * @description: 用户实体类
 * @date 2021/8/13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "User对象", description = "用户表")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "user主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "账户姓名")
    private String name;

    @ApiModelProperty(value = "绑定的电话号码")
    @NotEmpty(message = "密码不能为空")
    @Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$", message = "手机号码格式错误")
    private String phoneNumber;

    @ApiModelProperty(value = "账户密码")
    @NotEmpty(message = "密码不能为空")
    private String password;

    @ApiModelProperty(value = "微信号")
    private String wechat;

    @ApiModelProperty(value = "擅长技能")
    private String skill;

    @ApiModelProperty(value = "项目信息")
    @TableField(value = "project_info")
    private String projectInfo;

    @ApiModelProperty(value = "职业")
    private String job;

    @ApiModelProperty(value = "日薪")
    private Integer dailySalary;

    @ApiModelProperty(value = "工作年限")
    private Integer workingYear;

    @ApiModelProperty(value = "审核状态 0:未审核 1:已审核")
    private Integer isVerify;

    @ApiModelProperty(value = "是否为超级用户 0:不是 1:是")
    private Integer isAdmin;

    @ApiModelProperty(value = "是否被逻辑删除 0:不是 1:是")
    @TableLogic(delval = "id")
    //@TableField(select = false)
    private Long isDeleted;

    @ApiModelProperty(value = "头像存储地址")
    private String headUrl;

    @ApiModelProperty(value = "创建时间", hidden = true)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改时间", hidden = true)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "角色")
    @TableField(exist = false)
    private Long[] roleId;
}
